/***************纯粹的数据请求（如果使用这种可以删除掉fileUpload.js）******************/
// import request from "./core/request.js";
// export default request;

/********数据请求同时继承了文件上传（包括七牛云上传）************/
import upload from "./upload/upload.js";
import qs from "../qs/qs.min.js";
export default upload;

uni.addInterceptor('request', {
  invoke(args) {
    // request 触发前拼接 url 
    const {
		data,
		method
	} = args;
	if (method === 'GET') {
		const newData = qs.stringify(data, {
			arrayFormat: 'brackets'
		})
		console.log(data, newData);
		delete args.data;
		args.url = `${args.url}?${newData}`;
	}
  }
})